class Point2d {
    x : number;
    y : number;
    constructor (x : number, y : number) {
        this.x = x;
        this.y = y;
    }
    distance () : number {
        if (this.x != 0) if (this.x > this.y) return this.x;
        else return this.y;
        else return this.y;
    }
}
const x : number = 1;
let y : number = 2.0;
let p : Point2d = new Point2d (x, y);
function foo (v : Point2d) : number {
    return v.distance ();
}
let d : number = foo (p);
console.log (d);
